import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";
import {routers} from "@/router/routers";

const routes: Array<RouteRecordRaw> = [
  {
    path: "/register",
    component: () => import("@/views/register/index.vue"),
  },
  {
    path: "/login",
    component: () => import("@/views/login/index.vue"),
  },
  {
    path: "/",
    component: () => import("@/views/main/index.vue"),
    children: [
      {
        path: "/:menu",
        component: () => import("@/views/main/content.vue"),
        children: routers,
      },
    ],
  },
];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
});

export default router;
